package com.ruoyi.modularbusiness.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.modularbusiness.domain.Formbody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.modularbusiness.mapper.FormbodySecondaryMapper;
import com.ruoyi.modularbusiness.domain.FormbodySecondary;
import com.ruoyi.modularbusiness.service.IFormbodySecondaryService;

/**
 * 单内容Service业务层处理
 * 
 * @author liuzhen
 * @date 2023-04-12
 */
@Service
public class FormbodySecondaryServiceImpl implements IFormbodySecondaryService 
{
    @Autowired
    private FormbodySecondaryMapper formbodySecondaryMapper;


    @Override
    public List<FormbodySecondary> selSecondaryFrid(FormbodySecondary formbodySecondary) {
        return formbodySecondaryMapper.selSecondaryFrid(formbodySecondary);
    }

    @Override
    public Long batchSave(List<FormbodySecondary> formbodySecondaries) {
        return formbodySecondaryMapper.batchSave(formbodySecondaries);
    }

    /**
     * 查询单内容
     * 
     * @param fbid 单内容主键
     * @return 单内容
     */
    @Override
    public FormbodySecondary selectFormbodySecondaryByFbid(Long fbid)
    {
        return formbodySecondaryMapper.selectFormbodySecondaryByFbid(fbid);
    }

    /**
     * 查询单内容列表
     * 
     * @param formbodySecondary 单内容
     * @return 单内容
     */
    @Override
    public List<FormbodySecondary> selectFormbodySecondaryList(FormbodySecondary formbodySecondary)
    {
        return formbodySecondaryMapper.selectFormbodySecondaryList(formbodySecondary);
    }

    /**
     * 新增单内容
     * 
     * @param formbodySecondary 单内容
     * @return 结果
     */
    @Override
    public int insertFormbodySecondary(FormbodySecondary formbodySecondary)
    {
        formbodySecondary.setCreateTime(DateUtils.getNowDate());
        return formbodySecondaryMapper.insertFormbodySecondary(formbodySecondary);
    }

    /**
     * 修改单内容
     * 
     * @param formbodySecondary 单内容
     * @return 结果
     */
    @Override
    public int updateFormbodySecondary(FormbodySecondary formbodySecondary)
    {
        formbodySecondary.setUpdateTime(DateUtils.getNowDate());
        return formbodySecondaryMapper.updateFormbodySecondary(formbodySecondary);
    }

    /**
     * 批量删除单内容
     * 
     * @param fbids 需要删除的单内容主键
     * @return 结果
     */
    @Override
    public int deleteFormbodySecondaryByFbids(Long[] fbids)
    {
        return formbodySecondaryMapper.deleteFormbodySecondaryByFbids(fbids);
    }

    /**
     * 删除单内容信息
     * 
     * @param fbid 单内容主键
     * @return 结果
     */
    @Override
    public int deleteFormbodySecondaryByFbid(Long fbid)
    {
        return formbodySecondaryMapper.deleteFormbodySecondaryByFbid(fbid);
    }
}
